package com.itheima.controller;

import com.itheima.pojo.Result;
import com.itheima.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/report")
public class ReportController {

    @Autowired
    private ProductService productService;

    @GetMapping("/productUpOrDown")
    public Result productUpOrDown(){


       List<Map> mapList = productService.productUpOrDown();
       return Result.success(mapList);

    }

    @GetMapping("/productStatus")
    public Result productStatus(){

        List<Map> mapList = productService.productStatus();
        return Result.success(mapList);

    }
}
